eigen Interface

public interface eigen

An interface to the eigenvalue and eigenvector routines.


Module Procedures

private subroutine eigen_symm(vecs, a, vals, work, olwork, err)

Computes the eigenvalues, and optionally the eigenvectors, of a matrix by solving the eigenvalue problem when is a symmetric matrix.

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: vecs

Set to true to compute the eigenvectors as well as the eigenvalues; else, set to false to just compute the eigenvalues.

real(kind=real64), intent(inout), dimension(:,:) :: a

On input, the N-by-N symmetric matrix on which to operate. On output, and if vecs is set to true, the matrix will contain the eigenvectors (one per column) corresponding to each eigenvalue in vals. If vecs is set to false, the lower triangular portion of the matrix is overwritten.

real(kind=real64), intent(out), dimension(:) :: vals

An N-element array that will contain the eigenvalues sorted into ascending order.

real(kind=real64), intent(out), optional, pointer, dimension(:) :: work

An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

integer(kind=int32), intent(out), optional :: olwork

An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

class(errors), intent(inout), optional, target :: err

An error object to report any errors that occur.

private subroutine eigen_asymm(a, vals, vecs, work, olwork, err)

Computes the eigenvalues, and optionally the eigenvectors, of a matrix by solving the eigenvalue problem when is square, but not necessarily symmetric.

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(inout), dimension(:,:) :: a

On input, the N-by-N matrix on which to operate. On output, the contents of this matrix are overwritten.

complex(kind=real64), intent(out), dimension(:) :: vals

An N-element array containing the eigenvalues of the matrix. The eigenvalues are not sorted.

complex(kind=real64), intent(out), optional, dimension(:,:) :: vecs

An optional N-by-N matrix, that if supplied, signals to compute the right eigenvectors (one per column). If not provided, only the eigenvalues will be computed.

real(kind=real64), intent(out), optional, pointer, dimension(:) :: work

An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

integer(kind=int32), intent(out), optional :: olwork

An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

class(errors), intent(inout), optional, target :: err

An error object to report any errors that occur.

private subroutine eigen_gen(a, b, alpha, beta, vecs, work, olwork, err)

Computes the eigenvalues, and optionally the eigenvectors, by solving the eigenvalue problem: .

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(inout), dimension(:,:) :: a

On input, the N-by-N matrix . On output, the contents of this matrix are overwritten.

real(kind=real64), intent(inout), dimension(:,:) :: b

On input, the N-by-N matrix . On output, the contents of this matrix are overwritten.

complex(kind=real64), intent(out), dimension(:) :: alpha

An N-element array that, if beta is not supplied, contains the eigenvalues. If beta is supplied however, the eigenvalues must be computed as . This however, is not as trivial as it seems as it is entirely possible, and likely, that can overflow or underflow. With that said, the values in will always be less than and usually comparable with the NORM().

real(kind=real64), intent(out), optional, dimension(:) :: beta

An optional N-element array that if provided forces alpha to return the numerator, and this array contains the denominator used to determine the eigenvalues as . If used, the values in this array will always be less than and usually comparable with the NORM().

complex(kind=real64), intent(out), optional, dimension(:,:) :: vecs

An optional N-by-N matrix, that if supplied, signals to compute the right eigenvectors (one per column). If not provided, only the eigenvalues will be computed.

real(kind=real64), intent(out), optional, pointer, dimension(:) :: work

An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

integer(kind=int32), intent(out), optional :: olwork

An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

class(errors), intent(inout), optional, target :: err

An error object to report any errors that occur.

private subroutine eigen_cmplx(a, vals, vecs, work, olwork, rwork, err)

Computes the eigenvalues, and optionally the eigenvectors, of a matrix by solving the eigenvalue problem when is square, but not necessarily symmetric.

Arguments

Type IntentOptional Attributes Name
complex(kind=real64), intent(inout), dimension(:,:) :: a

On input, the N-by-N matrix on which to operate. On output, the contents of this matrix are overwritten.

complex(kind=real64), intent(out), dimension(:) :: vals

An N-element array containing the eigenvalues of the matrix. The eigenvalues are not sorted.

complex(kind=real64), intent(out), optional, dimension(:,:) :: vecs

An optional N-by-N matrix, that if supplied, signals to compute the right eigenvectors (one per column). If not provided, only the eigenvalues will be computed.

complex(kind=real64), intent(out), optional, target, dimension(:) :: work

An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

integer(kind=int32), intent(out), optional :: olwork

An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

real(kind=real64), intent(out), optional, target, dimension(:) :: rwork

An optional input, that if provided, prevents any local memory allocation for real-valued workspaces. If not provided, the memory required is allocated within. If provided, the length of the array must be at least 2 * N.

class(errors), intent(inout), optional, target :: err

An error object to report any errors that occur.